package Example;

public class Base1
{
    public String baseName = "base1";
    public Base1()
    {
        callName();
    }
    public void callName()
    {
        System. out. println(baseName);
    }
    static class Sub extends Base1
    {
        public String baseName = "sub";
        public void callName()
        {
            System. out. println (baseName) ;
        }
    }
    public static void main(String[] args)
    {
        Base1 b = new Sub();
        System.out.println(b.baseName);
        b.callName();
    }
}
